CPU 686
BITS 32

section .text

global _handler
extern _queuePut
extern _apontQueue
extern _event

_handler:
	push eax 
	push edx
	push ecx
	
	or dword[_event], 0x01
	
	in al, 0x60
	movzx eax, al
	push eax
	
	mov eax, long [_apontQueue]
	push eax
	STI
	call _queuePut
	
	add esp, 8

	mov al, 20h ; sinaliza EOI para o PIC-1
	out 20h, al
	
	pop ecx
	pop edx
	pop eax 

	iretd
END